<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>个人信息</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__ADMIN__css/style.css"  media="all">
  <link rel="stylesheet" href="__ADMIN__layui/css/layui.css"  media="all">
</head>
<body>
<div class="pad-20">
  <fieldset class="layui-elem-field layui-field-title">
  <legend>个人信息</legend>
  </fieldset>
  <form class="layui-form" action="" method="post" enctype="multipart/form-data">
    <!--基本信息-->
    <div class="layui-form-item">
      <label class="layui-form-label"><i class="layui-error-ts">*</i> 登录名</label>
      <div class="layui-input-block">
        <input class="layui-input newsName" lay-verify="required" placeholder="请输入用户名" value="{$info['username']}" type="text" name="data[username]">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label"><i class="layui-error-ts">*</i> 角色</label>
      <div class="layui-input-block">
        <select name="data[catid]" lay-verify="required">
          <option value="">请选择角色</option>
          <volist name="cateType" id="val">
          <option value="{$val['id']}" <eq name="val['id']" value="$info['catid']">selected=""</eq>>{$val['title']}</option>
          </volist>
        </select>
      </div>
    </div>
    <div class="layui-form-item upload-row">
      <label class="layui-form-label">头像</label>
      <div class="layui-input-inline" style="width:850px;">
        <input class="layui-input" name="data[headimg]" placeholder="请选择文件上传" type="text" value="{$info['headimg']}" readonly="" style="width:600px;display:inline-block;">
        <button type="button" class="layui-btn buttonup"><i class="layui-icon">&#xe67c;</i>文件浏览</button>
        <notempty name="info['id']"><button type="button" class="layui-btn  open-file"><i class="layui-icon">&#xe64a;</i>  查看文件</button></notempty>
      </div>
      <div class="layui-form-mid layui-word-aux">建议尺寸大小：100*100PX</div>
      <div id="fileurl" style="display:none;"><img src="/Uploads/{$info['headimg']}" width="300"/></div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label"> 手机</label>
      <div class="layui-input-block">
        <input class="layui-input newsName" lay-verify="required" placeholder="请输入手机" value="{$info['telphone']}" type="text" name="data[telphone]">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label"> 邮箱</label>
      <div class="layui-input-block">
        <input class="layui-input newsName" lay-verify="required" placeholder="请输入邮箱" value="{$info['email']}" type="text" name="data[email]">
      </div>
    </div>
    <!--基本信息-->
    <div class="layui-form-item">
      <div class="layui-input-block">
        <input type="hidden" name="id" value="{$info['id']|default=''}">
        <button class="layui-btn" lay-submit="" lay-filter="addNews">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
  </form>
</div>
<div class="yzui-filler"></div>
<script src="__ADMIN__js/jquery-1.9.1.min.js" charset="utf-8"></script>
<script type="text/javascript" src="__COMMON__ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__COMMON__ueditor/ueditor.all.js"></script>
<script src="__ADMIN__layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script type="text/javascript">
  layui.use(['form', 'layedit', 'laydate'], function(){
    var form = layui.form
    ,layer = layui.layer
    ,layedit = layui.layedit
    ,laydate = layui.laydate;
  });
  layui.use('element', function(){
  var $ = layui.jquery
  ,element = layui.element;
  });
  $(function(){
    // 文件上传
    $(".upload-row").each(function(i){
      $(this).find(".buttonup").click(function(){
        window.open('{:U('Tool/uploadImage', '', '')}?id='+ i, '文件上传', 'height=100, width=600, top='+(screen.availHeight-100)/2+', left='+(screen.availWidth-600)/2+', toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
      });
    });
    $(".open-file").click(function(){
      var fileroute = '{$info["headimg"]}';
      if(fileroute == ""){
        layer.alert('暂无文件');return false;
      }
      layer.open({
        type: 1,
        title: false,
        closeBtn: 1,
        skin: 'layui-layer-nobg', //没有背景色
        shadeClose: true,
        content: $('#fileurl')
      });
    });
  });
</script>
</body>
</html>
